<template>
  <div v-loading='pageLoading'>
    <z-table :list="list" :tableProps="tableProps" :columns="columns">
    </z-table>
    <z-pagination :pagination="pagination" :total="total" :page.sync="query.page" :limit.sync="query.size"
      @change="getList"></z-pagination>
  </div>
</template>

<script>
import commonMixin from '@/views/_common/mixin'
export default {
  mixins: [commonMixin],
  props: {
    mo_no: {
      type: String,
      default: '',
    },
  },
  name: 'tab7',
  watch: {
    mo_no: {
      handler(v, o) {
        if (v) {
          this.query.queryString.mo = v
          this.getList()
        } else {
          this.list = []
          this.total = 0
        }
      },
      immediate: true,
    },
  },
  data() {
    return {
      apiList: this.$api.yieldrateReport,
      query: {
        queryString: {
          mo: null,
        },
      },
      tableProps: {
        border: true,
        hideOperations: true,
      },
      columns: [
        { title: '工单号', key: 'mo_no', width: 140, fixed: 'left' },
        { title: '日期', key: 'work_date', width: 80, fixed: 'left' },
        { title: '机种编码', key: 'model_code', width: 100 },
        { title: '机种名称', key: 'model_name', width: 120 },
        { title: '产品型号编码', key: 'sku_code', width: 100 },
        { title: '产品型号名称', key: 'sku_name', width: 120 },
        { title: '产品规格', key: 'sku_spec', width: 160 },
        { title: '产品型号简码', key: 'brief_code', width: 120 },
        { title: '投产线别', key: 'line_name', width: 120 },
        { title: '工站', key: 'group_name', width: 120 },
        { title: '直通合格数量', key: 'pass_qty', width: 100 },
        { title: '直通不良数量', key: 'fail_qty', width: 100 },
        { title: '重工合格数量', key: 'repass_qty', width: 100 },
        { title: '重工不良数量', key: 'refail_qty', width: 100 },
        { title: '总计合格数量', key: 'total_pass_qty', width: 100 },
        { title: '总计不良数量', key: 'total_fail_qty', width: 100 },
        { title: '直通率', key: 'fpy', width: 70, fixed: 'right' },
        { title: '良率', key: 'yield_rate', width: 70, fixed: 'right' },
      ],
    }
  },
  created() {},
}
</script>

<style>
</style> 